package timu;

public class ji {
    public static void main(String[] args) {
        int count = 0;
        System.out.println("   母鸡   公鸡   小鸡");
        for (int hen = 0; hen <= 20; hen++) {
            for (int gongji = 0; gongji <= (100 - hen * 5) / 3; gongji++) {
                int xiaoji = 100 - hen - gongji;
                if (xiaoji % 3 == 0 && hen * 5 + gongji * 3 + xiaoji / 3 == 100) {
                    System.out.println("    " + hen + "     " + gongji + "     " + xiaoji);
                    count++;
                }
            }
        }
        System.out.println("总共有 " + count + " 种买法。");
    }
}
